package api

import (
	"fmt"
	"github.com/gin-gonic/gin"
	"strconv"
)

type ProductCollectionController struct{}

func (ProductCollectionController) AddCollection(c *gin.Context) {
	productId, _ := strconv.Atoi(c.PostForm("product_id"))
	var errMsg string
	if productId == 0 {
		errMsg = "商品ID不合法"
		goto returnErr
	}
	fmt.Print(productId)

returnErr:
	c.JSON(200, gin.H{
		"code": "500",
		"msg":  errMsg,
		"data": [0]string{},
	})
}
